using UnityEngine;

public class PlayerIdleState : PlayerGroundState
{
    public PlayerIdleState(StateMachine stateMachine, string stateName, Player player) : base(stateMachine, stateName, player)
    {

    }

   

    public override void Enter()
    {
        base.Enter();
        player.SetVelocity(0, rb.linearVelocity.y);
    }

    public override void UpDate()
    {
        base.UpDate();



        if (player.moveInput.x==player.facingDir&&player.wallDetected)
        {
            return;
        }




        if (player.moveInput.x != 0)
        {
            stateMachine.ChangeState(player.playerMoveState);
        }

        //if (player.groundDetected==false)
        //{
        //    stateMachine.ChangeState(player.playerFallState);
        //}


       
    }

    public override void Exit()
    {
        base.Exit();
    }
}
